package com.example.jpetstoreclient.domain;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@TableName(value = "cart",autoResultMap = true)
@NoArgsConstructor
public class CartItem {


    private int user_id;
    private int animal_id;
    private int number;

    @TableId(type = IdType.AUTO)
    private int cart_id;

    @TableField(exist = false)
    private Animal animal;


    //注意这个参数顺序，不然会映射错位（要和查询结果参数顺序一致）
    public CartItem(int cart_id,int user_id, int animal_id, int number ) {
        this.cart_id = cart_id;
        this.user_id = user_id;
        this.animal_id = animal_id;
        this.number = number;
    }

    public CartItem(int user_id, int animal_id, int number) {
        this.user_id = user_id;
        this.animal_id = animal_id;
        this.number = number;
    }




}
